how to get current date in java

81

get today date in java 8 -

LocalDate localDate = LocalDate.now();

how to get current date in java -

long millis=System.currentTimeMillis();  
java.sql.Date date=new java.sql.Date(millis);  
System.out.println(date);

Comments

Submit
0 Comments